{% extends "default/base.html" %}
{% load i18n %}

{% block content %}
<ul class="breadcrumb">
	<li><a href="{% url market_home %}">{% trans "Home" %}</a><span class="divider">/</span></li>
	<li><a href="{% url market_buy %}">{% trans "Buy" %}</a><span class="divider">/</span></li>
	<li class="active">{% trans "Categories" %}</li>
</ul>

<div class="row">
<div class="span12 offset2">
<h2>{% trans "All Categories" %}</h2>

<table class="zebra-striped">
<thead>
<tr>
	<th>Categories</th>
	<th>Subcategories</th>
</tr>
</thead>
<tbody>


{% for category in marketplace.marketcategory_set.all %}

   {% ifnotequal category.product_set.count 0 %}
	<tr>
	<td><h3><a href="{% url market_search_category category.slug %}">{{ category.name }}</a></h3></td>
	<td>
	{% for subcategory in category.subcategories.all %}
	   {% ifnotequal subcategory.product_set.count 0 %}
	<p><em><a href="{% url market_search_subcategory category.slug subcategory.slug %}">{{ subcategory.name }}</a></em></p>
	   {% endifnotequal %}
	{% endfor %}
	</td>
	</tr>
   {% endifnotequal %}
	
{% endfor %}

</tbody>
</table>
</div>
</div>
{% endblock %}
